function OS_Bitmap(host,id)
{
	this.$super=OS_Resource;
	if (this.$super(host,id)===false) return;
	delete this.$super;
	
	this.width=0;
	this.height=0;
	this.offsetx=0;
	this.offsety=0;
	this.source=null;
	
	this.loadBitmap=function()
	{
		var imageid=this.resourceNode.getElementsByTagName("source")[0].childNodes[0].nodeValue;
		this.source=OS_Resource.resource.get(imageid);
		if (this.resourceNode.getElementsByTagName("size").length>0)
		{
			this.width=Number(this.resourceNode.getElementsByTagName("size")[0].getElementsByTagName("width")[0].childNodes[0].nodeValue);
			this.height=Number(this.resourceNode.getElementsByTagName("size")[0].getElementsByTagName("height")[0].childNodes[0].nodeValue);
		}
		else
		{
			this.width=host.config.squarewidth;
			this.height=host.config.squareheight;
		}
		
		if (this.resourceNode.getElementsByTagName("position").length>0)
		{
			this.offsetx=Number(this.resourceNode.getElementsByTagName("position")[0].getElementsByTagName("left")[0].childNodes[0].nodeValue);
			this.offsety=Number(this.resourceNode.getElementsByTagName("position")[0].getElementsByTagName("top")[0].childNodes[0].nodeValue);
		}
		else
		{
			this.offsetx=Number(this.resourceNode.getElementsByTagName("coordinate")[0].getElementsByTagName("col")[0].childNodes[0].nodeValue)*this.width;
			this.offsety=Number(this.resourceNode.getElementsByTagName("coordinate")[0].getElementsByTagName("row")[0].childNodes[0].nodeValue)*this.height;
		}
		
		if (this.resourceNode.getElementsByTagName("span").length>0)
		{
			this.width*=Number(this.resourceNode.getElementsByTagName("span")[0].getElementsByTagName("colspan")[0].childNodes[0].nodeValue);
			this.height*=Number(this.resourceNode.getElementsByTagName("span")[0].getElementsByTagName("rowspan")[0].childNodes[0].nodeValue);
		}
	}
}
